package com.zz.config;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.oas.annotations.EnableOpenApi;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;

import java.util.ArrayList;

/**
 * Copyright Zz
 * FileName: SwaggerConfig
 * Author:   Zz
 * Date:     2023/6/214:21
 * Description:Swagger配置类
 * hISTORY:
 * <author>  <time>     <version>    <desc>
 * 作者姓名   修改时间       版本号       描述
 */

@Configuration
@EnableOpenApi // 开启Swagger3.0
public class SwaggerConfig {

  // 配置swagger的Docket的bean实例
  @Bean
    public Docket docket(){
      return new Docket(DocumentationType.OAS_30)
              .apiInfo(apiInfo());
  }


  // 配置Swagger信息
  private ApiInfo apiInfo(){
    Contact contact=new Contact(
            "Zz987",
            "https://gitee.com/zzc987",
            "544546204@qq.com");
    return new ApiInfo(// ApiInfo类没有set方法，只能通过构造器
            "江科大健康驿站接口文档",
            "接口文档",
            "1.0",
            "https://gitee.com/zzc987/software",
            contact,
            "Apache 2.0",
            "http://www.apache.org/licenses/LICENSE-2.0",
            new ArrayList<>());
  }

}
